package com.warmheart.builder.access;

import com.warmheart.core.co.base.BaseCoBuilder;
import com.warmheart.core.co.oper.Co;
import com.warmheart.entity.access.AccessLog;

/**
 * 
 * @ClassName: AccessLog
 * @Description: 访问记录实体CoBuilder类，对应表名称为tb_access_log
 *               温馨提示：不要修改该实体CoBuilder类的任何字段
 * @author ZhangJianyang
 * @date 2025年06月16日 下午13:05:35
 *
 */
public class AccessLogCoBuilder extends BaseCoBuilder<AccessLog, AccessLogCoBuilder> {

    private final AccessLog t;

    @Override
    protected AccessLogCoBuilder self() {
        return this;
    }

    @Override
    public AccessLog core() {
        return this.t;
    }

    public AccessLogCoBuilder(AccessLog accessLog) {
        t = accessLog;
    }

    /**
     * 用户ID
     */
    private Co<AccessLog, AccessLogCoBuilder> userId;

    /**
     * 资源类型
     */
    private Co<AccessLog, AccessLogCoBuilder> resourceType;

    /**
     * 资源ID
     */
    private Co<AccessLog, AccessLogCoBuilder> resourceId;

    /**
     * 操作类型
     */
    private Co<AccessLog, AccessLogCoBuilder> action;

    /**
     * IP地址
     */
    private Co<AccessLog, AccessLogCoBuilder> ipAddress;

    /**
     * 用户代理
     */
    private Co<AccessLog, AccessLogCoBuilder> userAgent;

    /**
     * 操作详情
     */
    private Co<AccessLog, AccessLogCoBuilder> details;

    public Co<AccessLog, AccessLogCoBuilder> userId() {
        if (this.userId == null) {
            this.userId = new Co<AccessLog, AccessLogCoBuilder>(self(), "user_id");
        }
        return this.userId;
    }

    public Co<AccessLog, AccessLogCoBuilder> resourceType() {
        if (this.resourceType == null) {
            this.resourceType = new Co<AccessLog, AccessLogCoBuilder>(self(), "resource_type");
        }
        return this.resourceType;
    }

    public Co<AccessLog, AccessLogCoBuilder> resourceId() {
        if (this.resourceId == null) {
            this.resourceId = new Co<AccessLog, AccessLogCoBuilder>(self(), "resource_id");
        }
        return this.resourceId;
    }

    public Co<AccessLog, AccessLogCoBuilder> action() {
        if (this.action == null) {
            this.action = new Co<AccessLog, AccessLogCoBuilder>(self(), "action");
        }
        return this.action;
    }

    public Co<AccessLog, AccessLogCoBuilder> ipAddress() {
        if (this.ipAddress == null) {
            this.ipAddress = new Co<AccessLog, AccessLogCoBuilder>(self(), "ip_address");
        }
        return this.ipAddress;
    }

    public Co<AccessLog, AccessLogCoBuilder> userAgent() {
        if (this.userAgent == null) {
            this.userAgent = new Co<AccessLog, AccessLogCoBuilder>(self(), "user_agent");
        }
        return this.userAgent;
    }

    public Co<AccessLog, AccessLogCoBuilder> details() {
        if (this.details == null) {
            this.details = new Co<AccessLog, AccessLogCoBuilder>(self(), "details");
        }
        return this.details;
    }
}